namespace Infrastructure.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddAccountsTable : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Accounts",
                c => new
                    {
                        UserId = c.String(nullable: false, maxLength: 20),
                        Password = c.String(nullable: false, maxLength: 20),
                        Email = c.String(nullable: false, maxLength: 80),
                        FirstName = c.String(nullable: false, maxLength: 80),
                        LastName = c.String(nullable: false, maxLength: 80),
                        Address1 = c.String(nullable: false, maxLength: 80),
                        Address2 = c.String(maxLength: 80),
                        City = c.String(nullable: false, maxLength: 80),
                        State = c.String(nullable: false, maxLength: 20),
                        Zip = c.String(),
                        Country = c.String(nullable: false, maxLength: 20),
                        Phone = c.String(nullable: false, maxLength: 20),
                        Language = c.String(nullable: false, maxLength: 80),
                        IsShowFavorites = c.Boolean(nullable: false),
                        IsShowBanners = c.Boolean(nullable: false),
                        Category_CategoryId = c.String(maxLength: 10),
                    })
                .PrimaryKey(t => t.UserId)
                .ForeignKey("dbo.Categories", t => t.Category_CategoryId)
                .Index(t => t.Category_CategoryId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.Accounts", new[] { "Category_CategoryId" });
            DropForeignKey("dbo.Accounts", "Category_CategoryId", "dbo.Categories");
            DropTable("dbo.Accounts");
        }
    }
}
